//
//  HWGoodsCollectionCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/24.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWGoodsCollectionCell.h"


@interface HWGoodsCollectionCell()
@property(strong,nonatomic) UIImageView *icoimageView;
@property(strong,nonatomic) UILabel *juanlabel;
@property(strong,nonatomic) UILabel *duihuanLabel;
// @property(strong,nonatomic) UIButton *quxiaoBut;
@end

@implementation HWGoodsCollectionCell

- (instancetype)initWithFrame:(CGRect)frame {
    
    
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
        
        
    }
    
    return  self;
}


- (void)setupUI {
    
      self.icoimageView = [[UIImageView alloc]initWithFrame:CGRectMake(((kScreenW-15-12*2)/2-83)/2, 30, 83, 83)];
      self.icoimageView.image = [UIImage imageNamed:@"shoujitupian"];
      [self addSubview:self.icoimageView];
    
    
         self.quxiaoBut = [UIButton buttonWithType:UIButtonTypeCustom];
        self.quxiaoBut.frame = CGRectMake(0, 0, 73, 25);
       // self.quxiaoBut.backgroundColor = blueBackgroundBT;
//        self.quxiaoBut.layer.cornerRadius = 25/2;
//        self.quxiaoBut.layer.masksToBounds = YES;
        [self.quxiaoBut setBackgroundImage:[UIImage imageNamed:@"xiaobeijins_bg"] forState:UIControlStateNormal];
    //   [self.quxiaoBut addTarget:self action:@selector(quxiaoButTap) forControlEvents:UIControlEventTouchUpInside];
        self.quxiaoBut.titleLabel.font = [UIFont systemFontOfSize:13];
        [self.quxiaoBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self.quxiaoBut setTitle:@"取消收藏" forState:UIControlStateNormal];
        [self.contentView addSubview: self.quxiaoBut];
        
    
      
      self.juanlabel = [[UILabel alloc]initWithFrame:CGRectMake(0,  self.icoimageView.bottom+14, (kScreenW-15-12*2)/2, 14)];
      self.juanlabel.text = @"iPhone 11 (A2223)";
      self.juanlabel.textColor = RGB(51, 51, 51);
      self.juanlabel.textAlignment = NSTextAlignmentCenter;
      self.juanlabel.font = [UIFont systemFontOfSize:14];
      
      [self addSubview:self.juanlabel];
    
    
      
      
      
      
        self.duihuanLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,  self.juanlabel.bottom+10, (kScreenW-15-12*2)/2, 13)];
        self.duihuanLabel.text = @"6000积分";
        self.duihuanLabel.textAlignment = NSTextAlignmentCenter;
        self.duihuanLabel.font = [UIFont systemFontOfSize:13];
        self.duihuanLabel.textColor = RGB(253,178, 50);
        [self addSubview:self.duihuanLabel];
    
    
    
    
}

- (void)quxiaoButTap {
    
    DLog(@"iohschudvhiohio");
}


-(void)setModel:(HWshangpingshoucangModel *)model {
    
    _model = model;
    [self.icoimageView  sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];
    
    self.juanlabel.text = model.name;
    self.duihuanLabel.text = model.money;
    
    
    
}


@end
